/* test_crypto.c
**
** Copyright (c) 2007, Meadhbh S. Hamrick
** All rights reserved.
** 
** Redistribution  and  use  in  source  and  binary  forms,  with  or  without
** modification, are permitted provided that the following conditions are met:
** 
**  * Redistributions of  source code must  retain the above  copyright notice,
**    this list of conditions and the following disclaimer.
** 
**  * Redistributions in binary form must reproduce the above copyright notice,
**    this list of conditions and the following disclaimer in the documentation
**    and/or other materials provided with the distribution.
** 
**  * Neither the  name of  Project Meadhbh  nor the names of  its contributors
**    may be used  to endorse  or promote  products derived from this  software
**    without specific prior written permission.
** 
** THIS SOFTWARE IS PROVIDED BY  THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY  EXPRESS OR IMPLIED WARRANTIES,  INCLUDING, BUT NOT  LIMITED TO, THE
** IMPLIED WARRANTIES  OF MERCHANTABILITY AND FITNESS FOR  A PARTICULAR PURPOSE
** ARE DISCLAIMED.  IN NO  EVENT SHALL THE  COPYRIGHT OWNER OR  CONTRIBUTORS BE
** LIABLE  FOR  ANY  DIRECT,   INDIRECT,  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR
** CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED  TO,  PROCUREMENT  OF
** SUBSTITUTE GOODS  OR SERVICES;  LOSS OF USE,  DATA, OR PROFITS;  OR BUSINESS
** INTERRUPTION)  HOWEVER CAUSED  AND ON  ANY THEORY  OF LIABILITY,  WHETHER IN
** CONTRACT,  STRICT LIABILITY,  OR  TORT (INCLUDING  NEGLIGENCE OR  OTHERWISE)
** ARISING IN ANY WAY  OUT OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE
** POSSIBILITY OF SUCH DAMAGE.
** 
** $Id: test_crypto.c 66 2007-11-08 07:18:51Z msh.mobile $
*/

#include "mtest.h"
#include "test_md2.h"
#include "test_md4.h"
#include "test_md5.h"
#include "test_sha1.h"
#include "test_sha224.h"
#include "test_sha256.h"
#include "test_sha384.h"
#include "test_sha512.h"
#include "test_arc4.h"
#include "test_caesar.h"
#include "test_hc128.h"
#include "test_hc256.h"

CU_TestInfo suite_md2[] = {
  { "RFC1319 Test Vectors (init, update, digest)", test_md2_rfc_vectors },
  { "Test mc_mic_md2_clone", test_mc_mic_md2_clone },
  { "Test mc_mic_md2_clear", test_mc_mic_md2_clear },
  { "Test mc_mic_md2_initialize", test_mc_mic_md2_initialize },
  { "Test mc_mic_md2_update", test_mc_mic_md2_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_md4[] = {
  { "RFC1320 Test Vectors (init, update, digest)", test_md4_rfc_vectors },
  { "Test mc_mic_md4_clone", test_mc_mic_md4_clone },
  { "Test mc_mic_md4_clear", test_mc_mic_md4_clear },
  { "Test mc_mic_md4_initialize", test_mc_mic_md4_initialize },
  { "Test mc_mic_md4_update", test_mc_mic_md4_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_md5[] = {
  { "RFC1321 Test Vectors (init, update, digest)", test_md5_rfc_vectors },
  { "Test mc_mic_md5_clone", test_mc_mic_md5_clone },
  { "Test mc_mic_md5_clear", test_mc_mic_md5_clear },
  { "Test mc_mic_md5_initialize", test_mc_mic_md5_initialize },
  { "Test mc_mic_md5_update", test_mc_mic_md5_update},
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_sha1[] = {
  { "FIPS180-2 Test Vectors (init, update, digest)", test_sha1_fips_vectors },
  { "Test mc_mic_sha1_clone", test_mc_mic_sha1_clone },
  { "Test mc_mic_sha1_clear", test_mc_mic_sha1_clear },
  { "Test mc_mic_sha1_initialize", test_mc_mic_sha1_initialize },
  { "Test mc_mic_sha1_update", test_mc_mic_sha1_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_sha224[] = {
  { "FIPS180-2 Test Vectors (init, update, digest)", test_sha224_fips_vectors },
  { "Test mc_mic_sha224_clone", test_mc_mic_sha224_clone },
  { "Test mc_mic_sha224_clear", test_mc_mic_sha224_clear },
  { "Test mc_mic_sha224_initialize", test_mc_mic_sha224_initialize },
  { "Test mc_mic_sha224_update", test_mc_mic_sha224_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_sha256[] = {
  { "FIPS180-2 Test Vectors (init, update, digest)", test_sha256_fips_vectors },
  { "Test mc_mic_sha256_clone", test_mc_mic_sha256_clone },
  { "Test mc_mic_sha256_clear", test_mc_mic_sha256_clear },
  { "Test mc_mic_sha256_initialize", test_mc_mic_sha256_initialize },
  { "Test mc_mic_sha256_update", test_mc_mic_sha256_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_sha384[] = {
  { "FIPS180-2 Test Vectors (init, update, digest)", test_sha384_fips_vectors },
  { "Test mc_mic_sha384_clone", test_mc_mic_sha384_clone },
  { "Test mc_mic_sha384_clear", test_mc_mic_sha384_clear },
  { "Test mc_mic_sha384_initialize", test_mc_mic_sha384_initialize },
  { "Test mc_mic_sha384_update", test_mc_mic_sha384_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_sha512[] = {
  { "FIPS180-2 Test Vectors (init, update, digest)", test_sha512_fips_vectors },
  { "Test mc_mic_sha512_clone", test_mc_mic_sha512_clone },
  { "Test mc_mic_sha512_clear", test_mc_mic_sha512_clear },
  { "Test mc_mic_sha512_initialize", test_mc_mic_sha512_initialize },
  { "Test mc_mic_sha512_update", test_mc_mic_sha512_update },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_arc4[] = {
  { "ARC4 Test Vectors (init, update)", test_arc4_vectors },
  { "Test mc_ssc_arc4_clone", test_mc_ssc_arc4_clone },
  { "Test mc_ssc_arc4_clear", test_mc_ssc_arc4_clear },
  { "Test mc_ssc_arc4_initialize", test_mc_ssc_arc4_initialize },
  { "Test mc_ssc_arc4_update", test_mc_ssc_arc4_update },
  { "Test mc_ssc_arc4_keystream", test_mc_ssc_arc4_keystream },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_caesar[] = {
  { "CAESAR Test Vectors (init, update)", test_caesar_vectors },
  { "Test mc_ssc_caesar_clone", test_mc_ssc_caesar_clone },
  { "Test mc_ssc_caesar_clear", test_mc_ssc_caesar_clear },
  { "Test mc_ssc_caesar_initialize", test_mc_ssc_caesar_initialize },
  { "Test mc_ssc_caesar_encrypt", test_mc_ssc_caesar_encrypt },
  { "Test mc_ssc_caesar_decrypt", test_mc_ssc_caesar_decrypt },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_hc128[] = {
  { "HC128 Test Vectors (init, update)", test_hc128_vectors },
  { "Test mc_stream_hc128_clone", test_mc_stream_hc128_clone },
  { "Test mc_stream_hc128_clear", test_mc_stream_hc128_clear },
  { "Test mc_stream_hc128_initialize", test_mc_stream_hc128_initialize },
  { "Test mc_stream_hc128_update", test_mc_stream_hc128_update },
  { "Test mc_stream_hc128_keystream", test_mc_stream_hc128_keystream },
  CU_TEST_INFO_NULL
};

CU_TestInfo suite_hc256[] = {
  { "HC256 Test Vectors (init, update)", test_hc256_vectors },
  { "Test mc_stream_hc256_clone", test_mc_stream_hc256_clone },
  { "Test mc_stream_hc256_clear", test_mc_stream_hc256_clear },
  { "Test mc_stream_hc256_initialize", test_mc_stream_hc256_initialize },
  { "Test mc_stream_hc256_update", test_mc_stream_hc256_update },
  { "Test mc_stream_hc256_keystream", test_mc_stream_hc256_keystream },
  CU_TEST_INFO_NULL
};

CU_SuiteInfo mu_suites[] = {
  { "MD2", suite_md2_init, NULL, suite_md2 },
  { "MD4", suite_md4_init, NULL, suite_md4 },
  { "MD5", suite_md5_init, NULL, suite_md5 },
  { "SHA1", suite_sha1_init, NULL, suite_sha1 },
  { "SHA224", suite_sha224_init, NULL, suite_sha224 },
  { "SHA256", suite_sha256_init, NULL, suite_sha256 },
  { "SHA384", suite_sha384_init, NULL, suite_sha384 },
  { "SHA512", suite_sha512_init, NULL, suite_sha512 },
  { "ARC4", suite_arc4_init, NULL, suite_arc4 },
  { "Caesar Cipher", suite_caesar_init, NULL, suite_caesar },
  { "HC128", suite_hc128_init, NULL, suite_hc128 },
  { "HC256", suite_hc256_init, NULL, suite_hc256 },
  CU_SUITE_INFO_NULL
};
